import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { HttpModule } from '@angular/http';
import { RouterModule, Routes } from '@angular/router';

// ant design
import { NgZorroAntdModule } from 'ng-zorro-antd';

import { PagesModule } from './pages/pages.module';
import { AppComponent } from './app.component';
import { LoginComponent } from './login/login.component';

// 路由
import { PagesRoutingModule } from './pages/pages-routing.module';
import { AppRoutingModule } from './app-routing.module';
import { ForgetComponent } from './forget/forget.component';
import { RegisterComponent } from './register/register.component';

import { UserService } from './services/user.service';
import { CanDeactivateGuardService } from '../app/can-deactivate-guard.service';
import { LocationStrategy, PathLocationStrategy  } from '@angular/common';

@NgModule({
    imports: [
        BrowserModule,
        FormsModule,
        HttpClientModule,
        HttpModule,
        ReactiveFormsModule,
        BrowserAnimationsModule,
        // 能够接受一个可选的配置对象，用于引入外部的字体文件，类型为 { extraFontName: string, extraFontUrl: string
        // }。
        NgZorroAntdModule.forRoot(),
        // 业务
        PagesModule,
        // 路由
        PagesRoutingModule,
        AppRoutingModule
    ],
    declarations: [
        AppComponent,
        LoginComponent,
        ForgetComponent,
        RegisterComponent
    ],
    providers: [UserService, CanDeactivateGuardService,{provide: LocationStrategy, useClass: PathLocationStrategy }], 
    bootstrap: [AppComponent]
})
export class AppModule { }
